package com.example.car.volley.request.login;

import org.json.JSONException;
import org.json.JSONObject;

import com.example.car.manager.App;
import com.example.car.manager.Constant;
import com.example.car.manager.Constants;
import com.example.car.volley.response.Response;

public class LoginResponse extends Response {
	private String Tag;
	
	public LoginResponse() {
		super(Constants.LOGIN);
	}
	@Override
	public String getContentTag() {
		return	"memberinfo";
	}
	@Override
	public void parseContent(String Content) {
		if(isSuccess()){
		try {
		
			JSONObject json=new JSONObject(Content);
			App.getApp().saveStringToSharedPreference(Constant.sp.user_vb,json.getString("VB"));
			App.getApp().saveStringToSharedPreference(Constant.sp.usr_id,json.getString("ID"));
			App.getApp().saveStringToSharedPreference(Constant.sp.head_icon,json.getString("HEAD_PIC"));
			App.getApp().saveStringToSharedPreference(Constant.sp.login_name,json.getString("NAME"));
			App.getApp().saveStringToSharedPreference(Constant.sp.mobile,json.getString("MOBILE"));
		} catch (JSONException e) {
			e.printStackTrace();
		}
		}else{
			
		}
	}
}
